# Maintainer: CYBERDEViL <cyberdev [at] disroot [dot] org>
pkgname=searx-qt-git
pkgver=r311.d8ebdb5
pkgrel=1
pkgdesc="Desktop client application for Searx/SearXNG/searx-space"
arch=('any')
url="https://notabug.org/CYBERDEViL/searx-qt"
license=('GPL3')
depends=('python-requests' 'python-pyqt5' 'python-jsonschema'
         'python-beautifulsoup4')
optdepends=('python-pysocks: socks proxy support')
makedepends=('gettext' 'qt5-tools' 'python-build' 'python-installer'
             'python-wheel' 'python-setuptools')
provides=('searx-qt')
conflicts=('searx-qt')
source=("${pkgname}::git+$url#branch=master")
sha256sums=('SKIP')

pkgver() {
    cd "$pkgname"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

prepare() {
    cd ${srcdir}
    sed -i "s/__git__ = '.*'/__git__ = '$(pkgver)'/g" ${pkgname}/searxqt/version.py
    sed -i "s/Version=.*/Version=$(pkgver)/g" ${pkgname}/share/searx-qt.desktop
}

build() {
    cd "$srcdir/$pkgname"
    make
}

package() {
    cd "$srcdir/$pkgname"
    make DESTDIR="$pkgdir" install
}
